package com.xiao.framework.ds.example;

import com.xiao.framework.ds.example.service.MultiDataSourceService;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.ActiveProfiles;
import org.springframework.test.context.junit4.SpringRunner;

/**
 * @author <a href="mailto:xiaoquanidea@163.com">hutiquan</a>
 * @since 2019-08-25 10:02
 */
@RunWith(SpringRunner.class)
@SpringBootTest(classes =MultiDataSourceBootstrap.class)
@ActiveProfiles("rw")
public class MultiDataSourceTester {

  @Autowired
  private MultiDataSourceService service;

  @Test
  public void test01(){
    service.itemMaster();
    System.out.println("service = " + service);
  }

  @Test
  public void testR(){
    service.readItem();
  }

  @Test
  public void testW(){
    service.writeItem();
  }

}
